home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sources
/
xpick
/
xpick_11.z
/
xpick_11
/
xpick-1.1
/
xapply
< prev
next >
Wrap
Text File
|
1993-06-21
|
569b
|
36 lines
#!/bin/sh
#
# xapply [-l] command
#
# apply command to files in current directory selected via xpick
#
# gerry.tomlinson@newcastle.ac.uk June 1993
#
case $1 in
"-l") LONG=TRUE; shift;;
esac
case $# in
0) echo usage: xapply [-l] command
exit 1;;
esac
cmnd=$*
cmndargs=
XARGS='-xrm *ok.label:"$*" -xrm *ok.font:8x13bold -xrm *Command.font:8x13 -name xapply'
case $LONG in
TRUE) cmndargs=`ls -l . | eval xpick $XARGS -1 - | awk '{print $8}'` ;;
*) cmndargs=`ls . | eval xpick $XARGS -`;;
esac
case x$cmndargs in
x) ;;
*) eval $cmnd $cmndargs;;
esac